package com.ramble.buildingservice.domain.household.controller;

import com.ramble.buildingservice.domain.household.dto.HouseholdDetailDto;
import com.ramble.buildingservice.domain.household.service.HouseholdService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@Api(tags = "房屋", value = "HouseholdController")
@RestController
@RequestMapping("/household")
public class HouseholdController {

    @Autowired
    private HouseholdService householdService;

    @GetMapping("/{id}")
    public String getHouseholdName(@PathVariable("id") Long id) {
        return "id:" + id + " ; name:房屋名称";
    }

    @GetMapping("/{id}/detail")
    public HouseholdDetailDto getHouseholdDetail(@PathVariable("id") Long id) {
        return householdService.getHouseholdDetail(id);
    }
}
